﻿@model DavidCms.Web.Models.ArticlePO

@{
    ViewBag.Title = "编辑文章";
    Layout = "~/Views/Shared/CmsBgLayout.cshtml";
}

<h2>编辑文章</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>ArticlePO</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.NavigationId)
        </div>
        <div class="editor-field">
            @Html.DropDownList("NavigationId")
            @Html.ValidationMessageFor(model => model.NavigationId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        @Html.HiddenFor(model => model.publishTime)

        <div class="editor-label">
            @Html.LabelFor(model => model.Editer)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Editer)
            @Html.ValidationMessageFor(model => model.Editer)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Content)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Content)
            @Html.ValidationMessageFor(model => model.Content)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        @Html.HiddenFor(model => model.CreateTime)

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("返回文章列表", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/jqueryval", "~/Content/ueditor/ueditor.config.js", "~/Content/ueditor/ueditor.all.js")
    <script type="text/javascript">
        var editorOption = {
            initialFrameWidth: 784,
            initialFrameHeight: 400
        };
        var editor = new baidu.editor.ui.Editor(editorOption);
        editor.render('Content');
        $('form').submit(function () {
            $('#Content').val(editor.getContent());
        });
    </script>
}
